import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {AuthGuard} from "../../service/authGuard";

import {RiskCheckComponent} from "./risk-check/risk-check.component";
import {RiskCheckDetailComponent} from "./risk-check-detail/risk-check-detail.component";
import {RiskCheckExecutionComponent} from "./risk-check-execution/risk-check-execution.component";
import {RiskCheckExecutionDetailComponent} from "./risk-check-execution-detail/risk-check-execution-detail.component";

const routes: Routes = [
    {path: "", redirectTo: "list", pathMatch: "full"},
    {
      path: "list",
      component: RiskCheckComponent,
      canActivate: [AuthGuard],
      data: {
        title: 'RiskCheck'
      }
    },
    {
      path: ":id/detail",
      component: RiskCheckDetailComponent,
      canActivate: [AuthGuard],
      data: {
        title: 'RiskCheckDetail'
      }
    },
    {
      path: ":id/execution",
      component: RiskCheckExecutionComponent,
      canActivate: [AuthGuard],
      data: {
        title: 'RiskCheckExecution'
      }
    },
    {
      path: "execution/:id/detail",
      component: RiskCheckExecutionDetailComponent,
      canActivate: [AuthGuard],
      data: {
        title: 'RiskCheckExecutionDetail'
      }
    },
    // {
    //   path: "execution/:id/scan",
    //   component: RiskCheckScanComponent,
    //   canActivate: [AuthGuard],
    //   data: {
    //     title: 'RiskCheckScan'
    //   }
    // },
    {
      path: "item/:id/execution",
      component: RiskCheckExecutionComponent,
      canActivate: [AuthGuard],
      data: {
        title: 'RiskCheckExecution'
      }
    }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class RiskBoardRoutes {
}
